<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS实现无缝滚动</title>
    <style>
        *{
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            font-family: 'poppins',sans-serif;
        }
        body{
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: #111;
        }
        .container{
            position: relative;
            display: flex;
            width: 700px;
            overflow: hidden;
            mask-image: linear-gradient(90deg,transparent,#fff 20%,#fff 80%,transparent);
        }
        .container div{
            white-space: nowrap;
            animation: animate var(--t) linear infinite;
        }
        .container div:nth-child(2){
            animation: animate2 var(--t) linear infinite;
            animation-delay: calc(var(--t)/-2);
        }
        @keyframes animate {
            from{
                transform: translate(100%);
            }
            to{
                transform:  translate(-100%);
            }
        }
        @keyframes animate2 {
            from{
                transform: translate(0);
            }
            to{
                transform:  translate(-200%);
            }
        }
        .container div span{
            display: inline-flex;
            margin: 10px;
            letter-spacing: .2em;
            background-color: #333;
            color:#fff;
            padding: 5px 10px;
            border-radius: 5px;
        }
    </style>
    
</head>
<body>
    <div class="container" style="--t:20s">
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
    </div>
    <div class="container" style="--t:50s">
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
    </div>
    <div class="container" style="--t:30s">
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
    </div>
    <div class="container" style="--t:40s">
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
        <div>
            <span>HTML</span>
            <span>CSS</span>
            <span>javaScript</span>
            <span>PHP</span>
            <span>Java</span>
            <span>Vue</span>
            <span>threeJs</span>
        </div>
    </div>
</body>
</html>